﻿<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>#SuspendExempt - 语法 &amp; 使用 | AutoHotkey v2</title>
<meta name="description" content="The #SuspendExempt directive exempts subsequent hotkeys and hotstrings from suspension." />
<meta name="ahk:equiv-v1" content="lib/Suspend.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>#SuspendExempt</h1>

<p>豁免后续<a href="../Hotkeys.htm">热键</a>和<a href="../Hotstrings.htm">热字串</a>的<a href="Suspend.htm">挂起</a>.</p>

<pre class="Syntax"><span class="func">#SuspendExempt</span> <span class="optional">Exempt</span></pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>Exempt</dt>
  <dd>
    <!--p>Type: literal word/digit</p-->
    <p><strong>True</strong> 或 <strong>1</strong> 表示允许豁免后续热键, 或者 <strong>False</strong> 或 <strong>0</strong> 表示禁用豁免. 如果省略, 则默认为 <em>True</em>.</p>
  </dd>

</dl>
<h2 id="Remarks">备注</h2>
<p>可以通过 <a href="Suspend.htm">Suspend</a> 函数, 或<a href="../Program.htm#tray-icon">托盘图标</a>或<a href="../Program.htm#main-window">主窗口</a>挂起热键和热字符串.</p>
<p>如果在脚本中未指定此指令, 则在挂起脚本时禁用所有热键或热字符串, 即使是那些调用 <a href="Suspend.htm">Suspend</a> 函数的热键或热字符串.</p>
<p>该指令不影响 <a href="Hotkey.htm">Hotkey</a> 或 <a href="Hotstring.htm">Hotstring</a> 函数, 它们可以使用 <a href="Hotkey.htm#SuspendExempt">S 热键选项</a>或 <a href="../Hotstrings.htm#SuspendExempt">S 热字串选项</a>来代替.</p>
<p>和其他指令一样, #SuspendExempt 不能有条件地执行.</p>

<h2 id="Related">相关</h2>
<p><a href="Suspend.htm">Suspend</a>, <a href="../Hotkeys.htm">热键</a>, <a href="../Hotstrings.htm">热字串</a></p>

<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a class="ex_number" href="#ExBasic"></a> 本例中的第一个热键是用来切换暂停的. 为了防止这个热键在开启暂停后被暂停, 从而无法再关闭暂停, 必须将其豁免.</p>
<pre>#SuspendExempt  <em>; 从 Suspend 中豁免以下热键.</em>
#Esc::Suspend -1
#SuspendExempt False  <em>; 禁用下面任何热键/热字符串的豁免.</em>
^1::MsgBox "This hotkey is affected by Suspend."
</pre>
</div>

</body>
</html>